<?php

class DB{
    static $obj=null;

    private function __construct()
    {
        echo "mysql linked....";
    }
    static  function getObj(){
        if(is_null(self::$obj)){
            self::$obj=new self();
        }
        return self::$obj;
    }
    public function select(){
        echo "select data....";
    }
}
var_dump(DB::getObj());
var_dump(DB::getObj());